function setPerson (person) {
    if (person.sex=='女'){
        person.sex=1
    }
    if (person.sex=='男'){
        person.sex=0
    }
    switch (person.apartment) {
        case '北苑一号宿舍楼': {
            person.apartment='A1'
            break
        }
        case '北苑二号宿舍楼': {
            person.apartment='A2'
            break
        }
        case '北苑三号宿舍楼': {
            person.apartment='A3'
            break
        }
        case 'A4北苑四号宿舍楼': {
            person.apartment='A4'
            break
        }
        case '北苑五号宿舍楼': {
            person.apartment='A5'
            break
        }
        case '北苑六号宿舍楼': {
            person.apartment='A6'
            break
        }
        case '北苑七号宿舍楼': {
            person.apartment='A7'
            break
        }
        case '北苑八号宿舍楼': {
            person.apartment='A8'
            break
        }
        case '北苑九号宿舍楼': {
            person.apartment='A9'
            break
        }
        case '北苑一号宿舍楼': {
            person.apartment='B1'
            break
        }
        case '北苑二号宿舍楼': {
            person.apartment='B2'
            break
        }
        case '北苑三号宿舍楼': {
            person.apartment='B3'
            break
        }
        case '北苑四号宿舍楼': {
            person.apartment='B4'
        }
        case '北苑五号宿舍楼': {
            person.apartment='B5'
            break
        }
        case '北苑六号宿舍楼': {
            person.apartment='B6'
            break
        }
        case '北苑七号宿舍楼': {
            person.apartment='B7'
            break
        }
        case '北苑八号宿舍楼': {
            person.apartment='B8'
            break
        }
        case '北苑九号宿舍楼': {
            person.apartment='B9'
            break
        }
        case '北苑十号宿舍楼': {
            person.apartment='B10'
            break
        }
        case '北苑十二号宿舍楼': {
            person.apartment='B12'
            break
        }
        case '教职公寓': {
            person.apartment='C1'
            break
        }
        case '校外': {
            person.apartment='D1'
            break
        }
    }
    switch (person.role){
        case '外来人员':person.role=0;break;
        case '本科生':person.role=1;break;
        case '研究生':person.role=2;break;
        case '教工':person.role=3;break;
        case '职工':person.role=4;break;
    }
    // if (person.phone.length==11){
    //     person.phone= person.phone.substr(0, 3) + '****' +  person.phone.substr( person.phone.length - 4);
    // }
     return person
}

export default setPerson
